//
//  WJShowHtmlVC.m
//  WJBSApp
//
//  Created by dllo on 16/7/21.
//  Copyright © 2016年 王景伟. All rights reserved.
//

#import "WJShowHtmlVC.h"
#import "WJEssAndNewModel.h"
#import <WebKit/WebKit.h>

@interface WJShowHtmlVC ()

@property (nonatomic, strong) WKWebView *webView;

@property (nonatomic, strong) WJBaseView *myView;

@property (nonatomic, strong) WJBaseButton *button;

@end

@implementation WJShowHtmlVC

-(void)dealloc
{
    [_model release];
    [_webView release];
    [_myView release];
    [_button release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createView];
    
}

- (void)createView
{
    self.title = @"评论";
    self.myView = [[WJBaseView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, 64)];
    [self.view addSubview:self.myView];
    [_myView release];
    
    self.button = [WJBaseButton buttonWithTitle:@"<" frame:CGRectMake(20, 24, 30, 30) target:self action:@selector(back)];
    [self.myView addSubview:self.button];
    self.button.layer.cornerRadius = 15;
    self.button.layer.masksToBounds = YES;
    self.button.backgroundColor = [UIColor colorWithRed:16/255.0 green:16/255.0 blue:16/255.0 alpha:0.7];
    


    self.webView = [[WKWebView alloc]initWithFrame:CGRectMake(0, 64, WIDTH, HEIGHT -64)];
    [self.webView loadHTMLString:self.model.htmlModel.body baseURL:[NSURL URLWithString:self.model.htmlModel.source_url]];
    [self.view addSubview:self.webView];
    // 立即释放
    [_webView release];
}

- (void)back
{
    [self dismissViewControllerAnimated:YES completion:nil];
}








- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
